<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCrmSalesLogTable extends Migration
{
    /**
     * Run the migrations.
     *销售回访日志
     * @return void
     */
    public function up()
    {
        Schema::create('crm_sales_log', function (Blueprint $table) {
            $table->engine = 'MyISAM';
            $table->comment='crm 销售回访日志';
            $table->increments('id')->comment('自增键');
            $table->integer('crm_company_id')->index('crm_company_id')->unsigned()->default(0)->comment('公共库企业id');
            $table->integer('com_uid')->index('com_uid')->unsigned()->default(0)->comment('企业com_id');
            $table->string('log_content',2500)->default('')->comment('回访内容');
            $table->tinyInteger('log_type')->unsigned()->default(0)->comment('1电话，2上门，3技术，4财务，5信息备注，6其它');
            $table->tinyInteger('log_effect')->unsigned()->default(0)->comment('0未解决，1解决');
            $table->integer('crm_uid')->index('crm_uid')->unsigned()->default(0)->comment('销售ID');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('crm_sales_log');
    }
}
